package com.example.demo.test;

import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
import com.fasterxml.jackson.databind.ObjectMapper;

import java.io.IOException;

/**
 * @Description:
 * @author: liyuan
 * @data 2020-11-30 11:44
 */
public class JSON2 {
    public static void main(String[] args) throws IOException {
        ObjectMapper mapper = new ObjectMapper();
        String json = "{\"name\":\"haha\",\"id\":10}";
        JsonFactory factory = mapper.getFactory();
        JsonParser parser = factory.createParser(json);
        JsonToken jsonToken = parser.nextToken();
        jsonToken = parser.nextToken();
        String key = null, value = null;
        if (jsonToken == JsonToken.FIELD_NAME) {

        }
    }
}
